package cl.lexer.validator;

import cl.lexer.Token;
import cl.lexer.TokenType;

public class CloseBracketValidator implements TokenValidator {

    @Override
    public TokenType getType() {
        return TokenType.CLOSE_BRACKET;
    }

    @Override
    public boolean isValid(String value) {
        return ")".equals(value) || "}".equals(value) || "]".equals(value);
    }

    @Override
    public boolean possiblyValid(String value) {
        return isValid(value) || value.isEmpty();
    }

    @Override
    public Token generateToken(String value) {
        return new Token(TokenType.CLOSE_BRACKET, value);
    }

}
